package com.emip.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.emip.bean.SecondStoreBean;
import com.emip.dao.SecondStoreDAO;
import com.emip.service.SecondStoreService;


@Service("secondStoreService")
public class SecondStoreServiceImpl implements SecondStoreService {

	@Autowired
	private SecondStoreDAO secondStoreDAO;
	
	public List<SecondStoreBean> getByTimespan(String startDate, String endDate, String[] itemIds, String siteId) {
		return secondStoreDAO.getByTimespan(startDate, endDate, itemIds, siteId);
	}

	public SecondStoreBean merge(SecondStoreBean store) {
		return secondStoreDAO.merge(store);
	}

	public long getCount(String startDate, String endDate, String[] itemIds,
			String siteId) {
		return secondStoreDAO.getCount(startDate, endDate, itemIds, siteId);
	}

	public SecondStoreBean findById(int id) {
		return secondStoreDAO.findById(id);
	}

	public List<SecondStoreBean> getByTimespan(String startDate,
			String endDate, String[] itemIds, String siteId, int page, int size) {
		return secondStoreDAO.getByTimespan(startDate, endDate, itemIds, siteId, page, size);
	}

	public Date getLastDate(String itemId, String siteId) {
		return secondStoreDAO.getLastDate(itemId, siteId);
	}

	public List<SecondStoreBean> getLastNItemsBySiteID(String siteId,
			String itemId, int num) {
		return secondStoreDAO.getLastNItemsBySiteID(siteId, itemId, num);
	}

	public Object[] getStatistics(String startDate, String endDate,
			String itemIds, String siteId) {
		return secondStoreDAO.getStatistics(startDate, endDate, itemIds, siteId);
	}

	public SecondStoreBean findBySecond(String date, String siteId,
			String itemId) {
		return secondStoreDAO.findBySecond(date, siteId, itemId);
	}

	public long getCount(String date, String[] items, String siteId) {
		return secondStoreDAO.getCount(date, items, siteId);
	}

	public List<Object> getNormalStat(String startDate, String endDate, String itemIds, String siteId) {
		return secondStoreDAO.getNormalStat(startDate, endDate, itemIds, siteId);
	}

	public List<Object> getStat(String startDate, String endDate, String itemIds, String siteId) {
		return secondStoreDAO.getStat(startDate, endDate, itemIds, siteId);
	}

}
